package com.example.demo.io;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;

/**
 * @ClassName TestFileWriter
 * @Description TODO
 * @Author hly
 * @Date 2018\11\27 0027 13:51
 */
public class TestFileWriter {

    public static void main(String[] args) {

        FileWriter fw = null;
        try {
            fw = new FileWriter("/b.txt");
            for(int c=0;c<=60;c++){
                fw.write(c+""+"\n");
            }
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

//        try {
//            int b = 0;
//            FileReader fr = new FileReader("C:\\b.dat");
//            while ((b = fr.read()) != -1) {
//                System.out.print((char) b);
//            }
//            fr.close();
//        } catch (FileNotFoundException e) {
//            e.printStackTrace();
//        } catch (IOException e) {
//            e.printStackTrace();
//        }


    }
}
